package brain;

import java.util.ArrayList;

/**
 * 
 * @author JRVamplew
 *
 */
public class InputAnalysis {

	public static void retrieveInformation(String input) {
		ArrayList<ArrayList<ArrayList<String>>> wordInfo = new ArrayList<ArrayList<ArrayList<String>>>(); //ArrayList of 2D ArrayLists
		ArrayList<ArrayList<ArrayList<String>>> detailInfo = new ArrayList<ArrayList<ArrayList<String>>>();
		
		String[] sentenceArray = input.split("\\s");
		
		for(int i=0;i<sentenceArray.length;i++) {
			//Get word info
			String currentWord = sentenceArray[i];
			ArrayList<ArrayList<String>> wordInfoList = QueryBuilder.getWord(currentWord);
			ArrayList<ArrayList<String>> detailInfoList = QueryBuilder.getWord(currentWord);
			wordInfo.add(wordInfoList);
			//Create Lists for headings and data
			ArrayList<String> tempListHeadings = wordInfoList.get(1);
			ArrayList<String> tempListData = wordInfoList.get(0);
			if(tempListData.get(0).toString().equalsIgnoreCase(null)) {
				//Compare headings and data
				for(int j=0;j<tempListHeadings.size();j++) {
					if (tempListHeadings.get(j).toString().equalsIgnoreCase("phrased")) {
						if(tempListData.get(j).toString().equalsIgnoreCase("1")) {
							getPhraseData(currentWord);
						}
					} if (tempListHeadings.get(j).toString().equalsIgnoreCase("detailID")) {
						if(!tempListData.get(j).toString().equalsIgnoreCase(null)) {
							detailInfoList = QueryBuilder.getWordData(sentenceArray[i]);
							detailInfo.set(i, detailInfoList);
						}
					}
					else {
						System.out.println("Cannot find column.");
					}
				}
			}
		}
				
	}
	
	public static void getPhraseData(String currentWord) {
		
		
	}
	
	public static void getActions() {
		
		
	}
	
	public static void getTriggers() {
		
		
	}
	
	
	
}
